<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>桥接器模式</title>
</head>

<body>
    <script>
        // 设置主题
        class Theme{
            constructor(theme){
                this.theme = theme
            }
            getColor(){return 'white'}
            getBridge(){
                console.log(this.theme. ());
            }
        }
        class Black{getColor(){return 'black'}}
        class Red{getColor(){return 'red'}}
        let themes = new Theme(new Black)
        themes.getBridge()


    </script>
</body>

</html>